package com.sooncode.project.focusservice.service;

import com.sooncode.project.core.finder.Finder;
import com.sooncode.project.focusservice.model.CourseType;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CourseTypeService {
    public boolean add(Map map){
        CourseType model=new CourseType();
        model.add(map);
        return true;
    }
    public boolean modify(String id,Map map){
        CourseType model=getById(id);
        model.modify(map);
        return true;
    }
    public boolean delete(String id){
        CourseType model=getById(id);
        model.delete();
        return true;
    }
    public List<CourseType> getList() {
        return new Finder<>(CourseType.class).list();
    }
    public CourseType getById(String id){
        return new Finder<>(CourseType.class).byId(id);
    }
}
